package com.hex.ds.hdrs.period.task.converter;

import com.hex.ds.hdrs.common.utils.BaseUtil;
import com.hex.ds.hdrs.common.utils.HdrsDateUtil;
import com.hex.ds.hdrs.period.task.dto.PeriodTaskConfigDto;
import com.hex.ds.hdrs.period.task.po.PeriodTaskConfig;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring", imports = {BaseUtil.class, HdrsDateUtil.class})
public interface IPeriodTaskConfigConverter {

    @Mappings({
            @Mapping(target = "pkId", expression = "java(BaseUtil.getPkId())"),
            @Mapping(source = "maxExecutionTime", target = "maxExecutionTime"),
            @Mapping(source = "taskCode", target = "taskCode"),
            @Mapping(source = "upTs", target = "upTs")
    })
    PeriodTaskConfig toPeriodTaskConfig( String maxExecutionTime, String taskCode, String upTs);


}
